#include <iostream>
using namespace std;
int main()
{
    int n, k, a[110];
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    cout << a[k];
    return 0;
}